/* This file is part of MyRename
 * Copyright (C) 2005-2009 Kai-Chieh Ku (kjackie@gmail.com)
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either
 * version 3 of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

#pragma once


#define XEC_NONE		0x00000000
#define XEC_MINMAX		0x00000001
#define XEC_INTEGER		0x00000002
#define XEC_RIGHTBTN	0x00000100

// CXEditCtrl

class CXEditCtrl : public CEdit
{
	DECLARE_DYNAMIC(CXEditCtrl)

public:
	CXEditCtrl();
	virtual ~CXEditCtrl();
	static void Localize();

	void ModifyXECStyle(DWORD dwAdd, DWORD dwRemove = XEC_NONE);
	void SetDefaultText(LPCTSTR sDefText);
	void SetMinMax(int iMin, int iMax);
	void AppendFormatText(LPCTSTR sFormat, ...);
	static CFont m_fontSymbol;
protected:

//data members
	CButton *m_pButton;
	static CMenu m_btnMenu;
	CString m_sDefaultText;
	DWORD m_xEditStyle;
	int m_iMin;
	int m_iMax;

	DECLARE_MESSAGE_MAP()
public:
	afx_msg void OnEnSetFocus();
	afx_msg void OnEnKillFocus();
protected:
	virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam);
	virtual LRESULT DefWindowProc(UINT message, WPARAM wParam, LPARAM lParam);
};
